'use strict'
import { QueryInterface, DataTypes } from 'sequelize'

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface: QueryInterface, Sequelize: typeof DataTypes) {
    await queryInterface.bulkInsert(
      'Roles',
      [
        {
          id: 1,
          name: '前台',
          durationMonths: 1,
          price: 0,
          rank: 1,
          desc: '这是前台角色',
          createdAt: new Date(),
          updatedAt: new Date(),
        },
        {
          id: 2,
          name: '库存管理员',
          durationMonths: 2,
          price: 0.11,
          rank: 2,
          desc: '这是库存管理员，2个月有效期，已优惠<span style="color: red;font-weight: bold;">10元</span>',
          createdAt: new Date(),
          updatedAt: new Date(),
        },
        {
          id: 3,
          name: '产品管理员',
          durationMonths: 3,
          price: 0.21,
          rank: 3,
          desc: '这是产品管理员，3个月有效期',
          createdAt: new Date(),
          updatedAt: new Date(),
        },
        {
          id: 4,
          name: '运营管理员',
          durationMonths: 4,
          price: 0.31,
          rank: 4,
          desc: '这是运营管理员，4个月有效期',
          createdAt: new Date(),
          updatedAt: new Date(),
        },
        {
          id: 100,
          name: '超级管理员',
          durationMonths: 5,
          price: 0.41,
          rank: 5,
          desc: '这是超级管理员，5个月有效期',
          createdAt: new Date(),
          updatedAt: new Date(),
        },
      ],
      {},
    )
  },

  async down(queryInterface: QueryInterface, Sequelize: typeof DataTypes) {
    await queryInterface.bulkDelete('Roles', [], {})
  },
}
